package com.ydm.myapp001.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import com.ydm.myapp001.R;
import com.ydm.myapp001.service.MyStartService;

public class StartServiceActivity extends AppCompatActivity {
    Intent intent1;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start_service);
    }

    public void doClick(View v) {
        switch(v.getId()){
            case R.id.btn_start_service: {
                Log.d("YDMLog_StartSActivity", "StartClick: ");
                intent1 = new Intent(StartServiceActivity.this, MyStartService.class);
                startService(intent1);
            }
                break;
            case R.id.btn_stop_service: {
                stopService(intent1);
            }
            break;
            default:
                break;
        }
    }
}
